import React from 'react'
const My = () => {
  // 那本地存储的用户名和密码
  const username = localStorage.getItem('username')
  const password = localStorage.getItem('password')
  // 如果本地存储的用户名和密码为空，则跳转到登录页面
  if (!username || !password) {
    window.location.href = '/Login'
    alert('请登录')
  }


  return (
    <div>
    <p>我信息</p>
      <p>用户名：{username}</p>
      <p>密码：{password}</p>
      <button>退出</button>
    </div>
  )
}

export default My